﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Gufa.Entity.Configs
{
    public class ExperienceConfig : IEntityTypeConfiguration<Experience>
    {
        public void Configure(EntityTypeBuilder<Experience> builder)
        {
            builder.ToTable("T_Experience");
            builder.Property(e => e.Company).IsRequired();
            builder.Property(e => e.Position).HasMaxLength(20).IsRequired();
            builder.Property(e => e.Duration).IsRequired();
            builder.ToTable(tb => tb.HasCheckConstraint("CK_DelFlag_Values", "DelFlag IN (0, 1)"));
        }
    }
}
